package querybuilder

import "strings"

type OrderBy []string

func (order *OrderBy) Add(field string) {
	if order == nil {
		*order = OrderBy{field}
	} else {
		*order = append(*order, field)
	}
}

func (order OrderBy) Get() string {
	if order == nil {
		return ""
	} else {
		return strings.Join(order, " ")
	}
}

func (order OrderBy) String() string {
	return order.Get()
}
